package com.wangrui.mapper;

import com.wangrui.dto.MajorSchool;
import com.wangrui.utils.Page;
import com.wangrui.pojo.Major;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 王锐
 * @since 2020-07-10
 */
public interface MajorMapper extends BaseMapper<Major> {
/*    @Select("<script>" +
            " SELECT major.*,school.* from major,school WHERE major.sid=school.id" +
            "limit #{start},#{pageSize}"+
            " </script>")
    List<MajorSchool> getMajorSchool(Page<MajorSchool> page1);*/

    @Select(" SELECT major.*,school.name as schoolName,school.address from major,school WHERE major.sid=school.id limit #{start},#{pageSize}")
    List<MajorSchool> getMajorSchool(Page<MajorSchool> page1);

}
